using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace ClassLibrary1.Models.Mapping
{
    public class Bs_CompanyMap : EntityTypeConfiguration<Bs_Company>
    {
        public Bs_CompanyMap()
        {
            // Primary Key
            this.HasKey(t => t.CId);

            // Properties
            this.Property(t => t.CName)
                .HasMaxLength(50);

            this.Property(t => t.CTel)
                .HasMaxLength(20);

            this.Property(t => t.CFax)
                .HasMaxLength(20);

            this.Property(t => t.CPostCode)
                .HasMaxLength(10);

            this.Property(t => t.CAddress)
                .HasMaxLength(100);

            this.Property(t => t.CWebUrl)
                .HasMaxLength(50);

            this.Property(t => t.CEmail)
                .HasMaxLength(20);

            this.Property(t => t.CMemo)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("Bs_Company");
            this.Property(t => t.CId).HasColumnName("CId");
            this.Property(t => t.CName).HasColumnName("CName");
            this.Property(t => t.CTel).HasColumnName("CTel");
            this.Property(t => t.CFax).HasColumnName("CFax");
            this.Property(t => t.CPostCode).HasColumnName("CPostCode");
            this.Property(t => t.CAddress).HasColumnName("CAddress");
            this.Property(t => t.CWebUrl).HasColumnName("CWebUrl");
            this.Property(t => t.CEmail).HasColumnName("CEmail");
            this.Property(t => t.CMemo).HasColumnName("CMemo");
        }
    }
}
